public class Ex4_18{
	public static void main(String[] args){
		System.out.println("\nPattern I");
		for (int i = 1; i <= 6; i++){
			for (int j = 1; j <= i; j++)
				System.out.printf("%-2d", j);
			System.out.printf("\n");
		}

		System.out.println("\nPattern II");
		for (int i = 1; i <= 6; i++){
			for (int j = 1; j <= 7-i; j++)
				System.out.printf("%-2d", j);
			System.out.printf("\n");
		}

		System.out.println("\nPattern III");
		for (int i = 1; i <= 6; i++){
			for (int j = 1; j <= 6-i; j++)
				System.out.printf("%-2c", ' ');
			for (int j = i; j >= 1; j--)
				System.out.printf("%-2d", j);
			System.out.printf("\n");
		}

		System.out.println("\nPattern IV");
		for (int i = 1; i <= 6; i++){
			for (int j = 1; j <= i-1; j++)
				System.out.printf("%-2c", ' ');
			for (int j = 1; j <= 7-i; j++)
				System.out.printf("%-2d", j);
			System.out.printf("\n");
		}
	}
}